package com.ybxx.hr.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;
import com.ybxx.hr.dao.WorkDao;
import com.ybxx.hr.model.Work;
import com.ybxx.hr.model.WorkContent;
import com.ybxx.hr.service.WorkService;

public class WorkServiceImpl extends BaseServiceImpl<Work> implements
		WorkService {
	private WorkDao workDao;
	public WorkServiceImpl(WorkDao dao) {
		super(dao);
		this.workDao=dao;
		// TODO Auto-generated constructor stub
	}
	public List<Work> queryPage(Work work,QueryFilter filter) {
		String hql="from Work w";
		String condition=" where ";
		if(work!=null && StringUtils.isNotEmpty(work.getWname())){
			hql+=condition+" w.wname='"+work.getWname()+"' ";
		}
		return workDao.findByHql(hql, null,filter.getPagingBean());
	}
}
